package com.gcb.socket.p2p;

import java.net.*;
import java.io.*;

public class TestP2PClient {
    public static void main (String[] args) throws Exception {
        BufferedReader br = null;
        BufferedReader br2 = null;
        PrintWriter pw = null;
        Socket so = null;
        String ss = null;
        so = new Socket ("127.0.0.1",7777);
        br = new BufferedReader (new InputStreamReader(so.getInputStream()));
        br2 = new BufferedReader (new InputStreamReader (System.in));
        pw = new PrintWriter (new OutputStreamWriter(so.getOutputStream()),true);
        ss=br2.readLine();
        while (!ss.equals("byebye") ) {
            pw.println(ss);
            System.out.println ("Client:"+ss);
            System.out.println("Server:"+br.readLine());
            ss=br2.readLine();
        }
    }
}